home *** CD-ROM | disk | FTP | other *** search
- property iMyCDlist, iSourceCDnum, iMacCDtitlesLU, iBlockIt, iPixelRefCast, iBaseLeft, iCancelBaseCast, iProceedBaseCast, iProceedHiliteCast, iCancelHiliteCast, iProceedSprNum, iCancelSprNum, iSwapMode, iScriptToRun, iXOBJopen
- global gAssetPath, gRunFromCD, gDXRonCD, gWINdriveLetter, gComputerTypeK, gPDL, gcurrentmedialist
-
- on birth me
- global gMyMACvolName
- set iMyCDlist to EMPTY
- set iSourceCDnum to 0
- set iMacCDtitlesLU to [:]
- addProp(iMacCDtitlesLU, "1", "OMNIPEDIA")
- addProp(iMacCDtitlesLU, "2", "TNG EPISODES")
- addProp(iMacCDtitlesLU, "3", "TOS EPISODES")
- addProp(iMacCDtitlesLU, "4", "OMNIPEDIA 2")
- addProp(iMacCDtitlesLU, "5", "DS9 EPISODES")
- mCreateCDlist(me)
- set iScriptToRun to EMPTY
- set iSwapMode to #video
- set iPixelRefCast to the number of cast "Pixel Ref for cancel/proceed base"
- set iProceedBaseCast to the number of cast "proceed base"
- set iCancelBaseCast to the number of cast "cancel base"
- set iCancelHiliteCast to the number of cast "cancel CD hl"
- set iProceedHiliteCast to the number of cast "proceed CD HL"
- set iCancelSprNum to 35
- set iProceedSprNum to 48
- set iXOBJopen to objectp(factory("AppleCD SC XObject"))
- if getaProp(iMacCDtitlesLU, 4) <> gMyMACvolName then
- hputmsg("!!!! check the setting of gMyMacVolName against the iMacCDtitlesLU list. Bad match.")
- end if
- return me
- end
-
- on mShowBase me
- puppetSprite(iProceedSprNum, 1)
- puppetSprite(iCancelSprNum, 1)
- set the castNum of sprite iProceedSprNum to iProceedBaseCast
- set the castNum of sprite iCancelSprNum to iCancelBaseCast
- updateStage()
- end
-
- on mZapBase me
- set the castNum of sprite iProceedSprNum to iPixelRefCast
- set the castNum of sprite iCancelSprNum to iPixelRefCast
- puppetSprite(iCancelSprNum, 0)
- puppetSprite(iProceedSprNum, 0)
- updateStage()
- end
-
- on mActivateCanProButts me
- mShowBase(me)
- end
-
- on mClearCanProButts me
- if the castNum of sprite iProceedSprNum <> iPixelRefCast then
- mZapBase(me)
- end if
- end
-
- on mCreateCDlist me
- set iMyCDlist to EMPTY
- set Lwhat to the text of cast "History of Updates"
- set lk to the number of lines in Lwhat
- repeat with i = 1 to lk
- if line i of Lwhat contains "OMNI" then
- set Lstart to offset("OMNI", line i of Lwhat)
- set Lnum to value(char 4 + Lstart of line i of Lwhat)
- if (Lnum > 0) and (Lnum < 10) then
- put Lnum after iMyCDlist
- end if
- end if
- end repeat
- if iMyCDlist contains "4" then
- put "1" after iMyCDlist
- end if
- end
-
- on mAnyCDiOwnIsMounted me
- set Lcount to the number of chars in iMyCDlist
- if Lcount < 1 then
- return 0
- end if
- repeat with k = 1 to Lcount
- set Lnum to char k of iMyCDlist
- if gComputerTypeK = #WIN then
- if hFileIsHere(gWINdriveLetter & ":" & gPDL & "OMNI" & Lnum & ".TXT") then
- return 1
- end if
- next repeat
- end if
- if hFileIsHere(getaProp(iMacCDtitlesLU, Lnum) & gPDL & "OMNI" & Lnum & ".TXT") then
- return 1
- end if
- end repeat
- return 0
- end
-
- on mAnyOMNICDIsMounted me
- if gComputerTypeK = #WIN then
- if hFileIsHere(gWINdriveLetter & ":" & gPDL & "OMNI" & string(1) & ".TXT") then
- return -1
- end if
- else
- if hFileIsHere(getaProp(iMacCDtitlesLU, 1) & gPDL & "OMNI" & string(1) & ".TXT") then
- return -1
- end if
- end if
- repeat with k = 2 to 4
- if gComputerTypeK = #WIN then
- if hFileIsHere(gWINdriveLetter & ":" & gPDL & "OMNI" & string(k) & ".TXT") then
- return 1
- end if
- next repeat
- end if
- if hFileIsHere(getaProp(iMacCDtitlesLU, k) & gPDL & "OMNI" & string(k) & ".TXT") then
- return 1
- end if
- end repeat
- return 0
- end
-
- on mClearCDNum me
- set iSourceCDnum to EMPTY
- end
-
- on mSetCDNum me, pTowhat
- set iSourceCDnum to string(integer(pTowhat * -1))
- end
-
- on mIownthisCD me
- return iMyCDlist contains iSourceCDnum
- end
-
- on mVidCDisMounted me
- global gVideoPath
- if iSourceCDnum = EMPTY then
- hputmsg(">!mVidCDisMounted thinks iSourceCDnum is empty!")
- return 0
- end if
- if (iSourceCDnum = 1) and (iMyCDlist contains "4") then
- set iSourceCDnum to 4
- end if
- if gComputerTypeK = #WIN then
- if hFileIsHere(gWINdriveLetter & ":" & gPDL & "OMNI" & iSourceCDnum & ".TXT") then
- set gVideoPath to gWINdriveLetter & ":" & gPDL & "MEDIA" & gPDL
- return 1
- else
- return 0
- end if
- else
- if hFileIsHere(getaProp(iMacCDtitlesLU, iSourceCDnum) & gPDL & "OMNI" & iSourceCDnum & ".TXT") then
- set gVideoPath to getaProp(iMacCDtitlesLU, iSourceCDnum) & gPDL & "MEDIA" & gPDL
- return 1
- else
- return 0
- end if
- end if
- end
-
- on mRunningFromHD me
- if gRunFromCD or gDXRonCD then
- return 0
- else
- return 1
- end if
- end
-
- on mEvaluateVidPlay me, pQTshortnm
- mSetCDNum(me, getAt(gcurrentmedialist, 3))
- if mIownthisCD(me) then
- if mVidCDisMounted(me) then
- hShowVidButton(pQTshortnm)
- else
- if mRunningFromHD(me) then
- hShowAltVidButton(pQTshortnm)
- else
- end if
- end if
- end if
- end
-
- on mRequestCDSwap me, pWhat
- if mRunningFromHD(me) then
- if gComputerTypeK = #mac then
- mEjectMe(me)
- end if
- mActivateCanProButts(me)
- set iSwapMode to pWhat
- mAsk(me, pWhat)
- else
- hputmsg("! mRequestCDSwap tinks yooze not running from da HD, so you cant swap.")
- abort()
- end if
- end
-
- on mAsk me, pWhat
- if pWhat = "Media" then
- set lx to 4
- else
- set lx to iSourceCDnum
- end if
- set Lmyname to getaProp(iMacCDtitlesLU, lx)
- hReportStatus("For this " & pWhat & ", insert the >" & Lmyname & "< CD and click PROCEED.")
- end
-
- on mButtonHit me, pWhich, psprnum
- puppetSprite(psprnum, 1)
- set Lme to the castNum of sprite psprnum
- repeat while the stillDown
- set the castNum of sprite psprnum to the castNum of sprite psprnum + rollOver(psprnum)
- updateStage()
- set the castNum of sprite psprnum to Lme
- end repeat
- if rollOver(psprnum) = 0 then
- return
- end if
- updateStage()
- mButtonAction(me, pWhich)
- end
-
- on mButtonAction me, pWhich
- if pWhich = #PROCEED then
- if iSwapMode = #video then
- mProceedVid(me)
- else
- if iSwapMode = #MEDIA then
- mCancelTheSwap(me)
- do(iScriptToRun)
- end if
- end if
- else
- if pWhich = #CANCEL then
- mCancelTheSwap(me)
- end if
- end if
- end
-
- on mCancelTheSwap me
- hReportStatus(" ")
- mClearCanProButts(me)
- end
-
- on mProceedVid me
- global gNopeSND
- if mVidCDisMounted(me) then
- mCancelTheSwap(me)
- hOpenVideo()
- else
- hearit(gNopeSND)
- if gComputerTypeK = #mac then
- mEjectMe(me)
- end if
- mAsk(me, #video)
- end if
- end
-
- on mEjectMe me
- if not iXOBJopen then
- openXLib(the pathName & "AppleCD SC XObject")
- end if
- if objectp(LCD) then
- LCD(mdispose)
- end if
- set LCD to AppleCD(mnew)
- if not objectp(LCD) then
- alert("CD ejector failed to initialize.")
- exit
- end if
- LCD(mEject)
- if objectp(LCD) then
- LCD(mdispose)
- end if
- if not iXOBJopen then
- closeXLib(the pathName & "AppleCD SC XObject")
- end if
- end
-
- on mCheckForHomeCD me, pWhatScript
- global gVidIsPlaying
- mSetCDNum(me, "-4")
- if gComputerTypeK = #WIN then
- if hFileIsHere(gWINdriveLetter & ":" & gPDL & "OMNI" & 4 & ".TXT") then
- return 1
- else
- if gVidIsPlaying then
- return 0
- end if
- mRequestCDSwap(me, #MEDIA)
- set iScriptToRun to pWhatScript
- return 0
- end if
- else
- if hFileIsHere(getaProp(iMacCDtitlesLU, 4) & gPDL & "OMNI" & 4 & ".TXT") then
- return 1
- else
- if gVidIsPlaying then
- return 0
- end if
- mRequestCDSwap(me, #MEDIA)
- set iScriptToRun to pWhatScript
- return 0
- end if
- end if
- end
-